package com.sxg.service.impl;

import java.util.List;

import com.sxg.common.annotation.DataSource;
import com.sxg.common.enums.DataSourceType;
import com.sxg.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sxg.mapper.ShopConcernMapper;
import com.sxg.domain.ShopConcern;
import com.sxg.service.IShopConcernService;

/**
 * 店铺收藏Service业务层处理
 * 
 * @author 浪漫写尽歌谱
 * @date 2024-01-09
 */
@Service
@DataSource(value = DataSourceType.SLAVE)
public class ShopConcernServiceImpl implements IShopConcernService 
{
    @Autowired
    private ShopConcernMapper shopConcernMapper;

    /**
     * 查询店铺收藏
     * 
     * @param id 店铺收藏主键
     * @return 店铺收藏
     */
    @Override
    public ShopConcern selectShopConcernById(Long id)
    {
        return shopConcernMapper.selectShopConcernById(id);
    }

    /**
     * 查询店铺收藏列表
     * 
     * @param shopConcern 店铺收藏
     * @return 店铺收藏
     */
    @Override
    public List<ShopConcern> selectShopConcernList(ShopConcern shopConcern)
    {
        return shopConcernMapper.selectShopConcernList(shopConcern);
    }

    /**
     * 新增店铺收藏
     * 
     * @param shopConcern 店铺收藏
     * @return 结果
     */
    @Override
    public int insertShopConcern(ShopConcern shopConcern)
    {
        shopConcern.setCreateTime(DateUtils.getNowDate());
        return shopConcernMapper.insertShopConcern(shopConcern);
    }

    /**
     * 修改店铺收藏
     * 
     * @param shopConcern 店铺收藏
     * @return 结果
     */
    @Override
    public int updateShopConcern(ShopConcern shopConcern)
    {
        return shopConcernMapper.updateShopConcern(shopConcern);
    }

    /**
     * 批量删除店铺收藏
     * 
     * @param ids 需要删除的店铺收藏主键
     * @return 结果
     */
    @Override
    public int deleteShopConcernByIds(Long[] ids)
    {
        return shopConcernMapper.deleteShopConcernByIds(ids);
    }

    /**
     * 删除店铺收藏信息
     * 
     * @param id 店铺收藏主键
     * @return 结果
     */
    @Override
    public int deleteShopConcernById(Long id)
    {
        return shopConcernMapper.deleteShopConcernById(id);
    }
}
